﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;
using System.IO;


namespace Football_Application
{
    public class Championship
    {
        [System.Xml.Serialization.XmlAttributeAttribute()]
        private int  _championshipID{ get; set; }

        [System.Xml.Serialization.XmlAttributeAttribute()]
        private string _championshipName{ get; set; }

        [System.Xml.Serialization.XmlAttributeAttribute()]
        private string _country{ get; set; }

        [System.Xml.Serialization.XmlAttributeAttribute()]
        private static int _clubsAmount { get; set; }

            public int ChamionshipID
            {
                get { return _championshipID; }
                set { _championshipID = value; }
            }

            public string ChampionshipName
            {
                get { return _championshipName; }
                set { _championshipName = value; }
            }

            public string Country
            {
                get { return _country; }
                set { _country = value; }
            }

            public Championship()
            {
                this._championshipID   = 0;
                this._championshipName  = string.Empty ;
                this._country = string.Empty;
            }

            public  void CreateChampionship( string name, string country)
            {
                _championshipID = _clubsAmount + 1;
                _championshipName = name ;
                _country = country;
                _clubsAmount++;
            }
            public Championship(string name, string country)
            {
                _championshipID = _clubsAmount + 1;
                _championshipName = name;
                _country = country;
                _clubsAmount++;
            }

            public void UpdateChampionship(int chamionshipID, string name, string country)
            {
                _championshipID = chamionshipID ;
                _championshipName = name;
                _country = country;
            }

            public override string ToString()
            {
                return "Чемпионат №: \"" + _championshipID + "\"\n Название: " + _championshipName  +
                  "\n Страна: " + _country +"\n";
            }

    }
}
